Skip to content

feat(runtime): introduce experimental.runtimeMode#14254

Open
LingyuCoder wants to merge 21 commits into
mainfrom
codex/runtime-proxy-context-redesign
Open

feat(runtime): introduce experimental.runtimeMode#14254
LingyuCoder wants to merge 21 commits into
mainfrom
codex/runtime-proxy-context-redesign

Conversation

@LingyuCoder

@LingyuCoder LingyuCoder commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Introduce experiments.runtimeMode with the new "rspack" runtime mode while keeping webpack mode as the compatibility path.
  • Add rspack-mode runtime context rendering through __rspack_context, including lexical runtime-global declarations and context field binding for runtime modules and normal modules.
  • Move rspack-mode runtime helper access onto __rspack_context while preserving webpack-mode runtime-global output such as __webpack_require__.*.
  • Update module execution, hot update handling, chunk runtime module rendering, and module federation runtime helpers to pass and consume the runtime context consistently.
  • Adjust parser handling for rspack-mode runtime globals so known __webpack_require__.* references are rewritten to __rspack_context.* without losing member-chain suffixes.
  • Update runtime-mode tests, config/hot cases, and snapshots to cover the new runtime mode behavior.

@LingyuCoder LingyuCoder changed the title [codex] Implement rspack runtime context mode refactor Jun 2, 2026
@LingyuCoder LingyuCoder changed the title refactor refactor(runtime): introduce rspack context Jun 2, 2026
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

📦 Binary Size-limit

Comparing 4aea304 to chore(deps): update dependency terser-webpack-plugin to ^5.6.1 (#14393) by renovate[bot]

❌ Size increased by 248.25KB from 62.67MB to 62.91MB (⬆️0.39%)

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Rsdoctor Bundle Diff Analysis

Found 5 projects in monorepo, 5 projects with changes.

📊 Quick Summary
Project Total Size Gzip Size Change Gzip Change
popular-libs 1.7 MB 551.3 KB - -
react-1k 822.7 KB 218.2 KB - -
react-10k 5.6 MB 1.3 MB - -
react-5k 2.7 MB 669.1 KB - -
ui-components 4.8 MB 1.4 MB - -
📋 Detailed Reports (Click to expand)

📁 popular-libs

Path: ../build-tools-performance/cases/popular-libs/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 1.7 MB - -
🗜️ Gzip Size 551.3 KB - -
📄 JavaScript 1.7 MB - -
🎨 CSS 0 B - -
🌐 HTML 289.0 B - -
📁 Other Assets 0 B - -

📁 react-1k

Path: ../build-tools-performance/cases/react-1k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 822.7 KB - -
🗜️ Gzip Size 218.2 KB - -
📄 JavaScript 822.4 KB - -
🎨 CSS 0 B - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

📁 react-10k

Path: ../build-tools-performance/cases/react-10k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 5.6 MB - -
🗜️ Gzip Size 1.3 MB - -
📄 JavaScript 5.6 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

📁 react-5k

Path: ../build-tools-performance/cases/react-5k/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 2.7 MB - -
🗜️ Gzip Size 669.1 KB - -
📄 JavaScript 2.7 MB - -
🎨 CSS 21.0 B - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

📁 ui-components

Path: ../build-tools-performance/cases/ui-components/dist/rsdoctor-data.json

⚠️ No baseline data found - Unable to perform comparison analysis

Metric Current Baseline Change
📊 Total Size 4.8 MB - -
🗜️ Gzip Size 1.4 MB - -
📄 JavaScript 4.7 MB - -
🎨 CSS 111.7 KB - -
🌐 HTML 328.0 B - -
📁 Other Assets 0 B - -

Generated by Rsdoctor GitHub Action

@codspeed-hq

codspeed-hq Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will degrade performance by 2.07%

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

❌ 1 regressed benchmark
✅ 51 untouched benchmarks
⏩ 36 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime bundle@threejs-10x-production-sourcemap 462 ms 471.8 ms -2.07%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing codex/runtime-proxy-context-redesign (4aea304) with main (42487d9)

Open in CodSpeed

Footnotes

  1. 36 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@LingyuCoder LingyuCoder force-pushed the codex/runtime-proxy-context-redesign branch from 14633c9 to 59afc1b Compare June 4, 2026 04:49
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 4, 2026

Copy link
Copy Markdown

Deploying rspack with  Cloudflare Pages  Cloudflare Pages

Latest commit: 6aaaa72
Status: ✅  Deploy successful!
Preview URL: https://7ba87ee1.rspack-v2.pages.dev
Branch Preview URL: https://codex-runtime-proxy-context.rspack-v2.pages.dev

View logs

@LingyuCoder LingyuCoder force-pushed the codex/runtime-proxy-context-redesign branch from 5172147 to 55a76d8 Compare June 8, 2026 12:24
@LingyuCoder LingyuCoder changed the title refactor(runtime): introduce rspack context feat(runtime): introduce experimental.runtimeMode Jun 9, 2026
@LingyuCoder LingyuCoder force-pushed the codex/runtime-proxy-context-redesign branch from 0cc26f1 to e867c35 Compare June 9, 2026 07:50
@LingyuCoder LingyuCoder marked this pull request as ready for review June 9, 2026 07:52
Copilot AI review requested due to automatic review settings June 9, 2026 07:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e867c3553b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8363fcebee

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_core/src/compilation/build_module_graph/module_executor/execute.rs Outdated
@LingyuCoder LingyuCoder force-pushed the codex/runtime-proxy-context-redesign branch from 8363fce to c9b28c3 Compare June 10, 2026 03:34
@LingyuCoder LingyuCoder requested a review from stormslowly as a code owner June 10, 2026 03:34
@LingyuCoder LingyuCoder force-pushed the codex/runtime-proxy-context-redesign branch from c9b28c3 to 27ed515 Compare June 10, 2026 03:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 27ed515612

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_core/src/runtime_globals.rs Outdated
@LingyuCoder LingyuCoder force-pushed the codex/runtime-proxy-context-redesign branch 2 times, most recently from 601bdb6 to 6f1342e Compare June 11, 2026 02:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6f1342e59b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs
@LingyuCoder LingyuCoder force-pushed the codex/runtime-proxy-context-redesign branch from 6f1342e to 6aaaa72 Compare June 11, 2026 03:14

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6aaaa723b3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_plugin_mf/src/lib.rs
@LingyuCoder LingyuCoder force-pushed the codex/runtime-proxy-context-redesign branch from 6aaaa72 to 2b535e1 Compare June 11, 2026 04:16

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e54a9fa2c0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rspack/src/RuntimeGlobals.ts Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28a09dd0a6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs Outdated
@LingyuCoder LingyuCoder force-pushed the codex/runtime-proxy-context-redesign branch from 28a09dd to 0dc27ce Compare June 11, 2026 09:28
@LingyuCoder LingyuCoder force-pushed the codex/runtime-proxy-context-redesign branch from 3e12758 to 5081faf Compare June 12, 2026 11:36

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5081fafd84

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_plugin_javascript/src/parser_plugin/api_plugin.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6a55debe15

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_plugin_javascript/src/plugin/runtime_context.rs

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9f102bb614

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_plugin_esm_library/src/render.rs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 17ede82d2d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@LingyuCoder

Copy link
Copy Markdown
Contributor Author

@codspeedbot explain the regression

@codspeed-hq

codspeed-hq Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

@codspeedbot explain the regression

Regression analysis

I compared the latest head run (4f558e9) against main (c3c2717) and profiled both flagged benchmarks. Here's what's going on.

What regressed

Mode Benchmark BASE HEAD Change
Simulation rust@create_named_chunk_ids 5.9 ms 6 ms -2.75%
Simulation rust@mangle_exports 7 ms 7.1 ms -2.3%

Why it's very likely incidental, not a real hot-path regression

Both benchmarks measure compilation stages that never execute any of the code this PR touches. This PR changes runtime-context rendering (__rspack_context, experiments.runtimeMode, runtime module/global handling), but:

  • create_named_chunk_ids — time is dominated by find_graph_roots / ChunkGraph::get_chunk_root_modules (~70%), sort_unstable_by_key, and ESMImportSpecifierDependencyCondition::is_connection_active. None of these are modified by the diff.
  • mangle_exports — time is dominated by mangle_exports_info, optimize_code_generation, and allocator activity (mimalloc mi_* / _mi_page_malloc). Again untouched by the diff.

In both flamegraphs the regressed frames are overwhelmingly memory/cache-bound rather than doing more instructions (e.g. in create_named_chunk_ids, Option::as_ref is ~86% memory cost and the chunk-name closure is ~76% memory). That signature — unchanged call trees, costs shifting in the memory dimension — is the classic fingerprint of binary layout, inlining, and allocation-pattern shifts, not an algorithmic change. It lines up with the reported binary-size growth (+228 KB / +0.36%) from adding the new runtimeMode code path and config field: new code reshuffles symbol placement and allocation order, which nudges cache behavior in hot loops elsewhere.

Recommendation

  • The ~2.3–2.75% movements are small, in stages your PR doesn't functionally alter, and consistent with incidental layout/allocation noise rather than a true regression.
  • If you're satisfied with the analysis, you can acknowledge them on CodSpeed to clear the warning.
  • Note: the report header also flagged an Unknown Walltime execution environment — these two benchmarks run in Simulation mode (deterministic), so they aren't affected by that warning, but any Walltime benchmarks on standard hosted runners will be noisier. Macro Runners give the most stable Walltime numbers.

No code changes are needed for this — it's an explanation, not a fix. If you'd like, I can dig deeper into a specific frame or help confirm by isolating the config-field change.

Summary
  • Warming up the performance wizard...
  • Investigating the reported regression — Analyzed compare report and flamegraphs for both regressed benchmarks; regression is incidental to unrelated compilation stages, no code change needed
  • Handling comment — Comment handling finished successfully

Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot.

@github-actions

This comment was marked as outdated.

@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

📝 Benchmark detail: Open

Name Base (c3c2717) Current Change
10000_big_production-mode_disable-minimize + exec 12 s ± 107 ms 12 s ± 255 ms -0.16 %
10000_development-mode + exec 867 ms ± 12 ms 876 ms ± 33 ms +0.97 %
10000_development-mode_hmr + stats 159 ms ± 11 ms 156 ms ± 2.1 ms -2.00 %
10000_development-mode_noop-loader + exec 1.97 s ± 57 ms 2 s ± 226 ms +1.22 %
10000_production-mode + exec 993 ms ± 38 ms 997 ms ± 47 ms +0.44 %
10000_production-mode_persistent-cold + exec 1.15 s ± 11 ms 1.15 s ± 18 ms -0.12 %
10000_production-mode_persistent-hot + exec 625 ms ± 17 ms 625 ms ± 19 ms 0.00 %
10000_production-mode_source-map + exec 1.15 s ± 8.7 ms 1.16 s ± 25 ms +0.55 %
arco-pro_development-mode + exec 1.29 s ± 88 ms 1.27 s ± 80 ms -1.18 %
arco-pro_development-mode_hmr + stats 33 ms ± 0.39 ms 33 ms ± 2.1 ms +1.62 %
arco-pro_production-mode + exec 2.34 s ± 68 ms 2.35 s ± 72 ms +0.68 %
arco-pro_production-mode_generate-package-json-webpack-plugin + exec 2.44 s ± 60 ms 2.42 s ± 62 ms -0.91 %
arco-pro_production-mode_persistent-cold + exec 2.42 s ± 121 ms 2.37 s ± 89 ms -2.16 %
arco-pro_production-mode_persistent-hot + exec 346 ms ± 7.2 ms 345 ms ± 12 ms -0.23 %
arco-pro_production-mode_source-map + exec 2.77 s ± 136 ms 2.79 s ± 134 ms +0.64 %
arco-pro_production-mode_traverse-chunk-modules + exec 2.38 s ± 126 ms 2.35 s ± 66 ms -0.90 %
bundled-threejs_development-mode + exec 172 ms ± 2.9 ms 173 ms ± 4 ms +0.93 %
bundled-threejs_production-mode + exec 200 ms ± 4.9 ms 200 ms ± 5.9 ms -0.20 %
large-dyn-imports_development-mode + exec 1.18 s ± 26 ms 1.15 s ± 20 ms -2.30 %
large-dyn-imports_production-mode + exec 1.22 s ± 30 ms 1.21 s ± 39 ms -0.51 %
threejs_development-mode_10x + exec 826 ms ± 42 ms 820 ms ± 9 ms -0.68 %
threejs_development-mode_10x_hmr + stats 109 ms ± 6.2 ms 109 ms ± 7.5 ms +0.02 %
threejs_production-mode_10x + exec 2.88 s ± 7.5 ms 2.89 s ± 23 ms +0.34 %
threejs_production-mode_10x_persistent-cold + exec 3.02 s ± 34 ms 3 s ± 36 ms -0.56 %
threejs_production-mode_10x_persistent-hot + exec 380 ms ± 8.8 ms 381 ms ± 5.1 ms +0.21 %
threejs_production-mode_10x_source-map + exec 3.66 s ± 55 ms 3.67 s ± 79 ms +0.34 %
10000_big_production-mode_disable-minimize + rss memory 2150 MiB ± 24.1 MiB 2142 MiB ± 28.7 MiB -0.34 %
10000_development-mode + rss memory 553 MiB ± 18.2 MiB 551 MiB ± 21.4 MiB -0.44 %
10000_development-mode_hmr + rss memory 788 MiB ± 41.2 MiB 793 MiB ± 41.5 MiB +0.67 %
10000_development-mode_noop-loader + rss memory 852 MiB ± 13.9 MiB 851 MiB ± 12.7 MiB -0.04 %
10000_production-mode + rss memory 485 MiB ± 5.18 MiB 478 MiB ± 8.31 MiB -1.50 %
10000_production-mode_persistent-cold + rss memory 676 MiB ± 4.91 MiB 679 MiB ± 12.7 MiB +0.36 %
10000_production-mode_persistent-hot + rss memory 673 MiB ± 46.6 MiB 675 MiB ± 41.7 MiB +0.17 %
10000_production-mode_source-map + rss memory 484 MiB ± 22.6 MiB 479 MiB ± 20 MiB -1.12 %
arco-pro_development-mode + rss memory 459 MiB ± 15.6 MiB 446 MiB ± 7.51 MiB -2.68 %
arco-pro_development-mode_hmr + rss memory 472 MiB ± 2.47 MiB 466 MiB ± 2.72 MiB -1.40 %
arco-pro_production-mode + rss memory 627 MiB ± 18.2 MiB 616 MiB ± 22.9 MiB -1.87 %
arco-pro_production-mode_generate-package-json-webpack-plugin + rss memory 638 MiB ± 8.1 MiB 624 MiB ± 48.6 MiB -2.14 %
arco-pro_production-mode_persistent-cold + rss memory 718 MiB ± 24.5 MiB 711 MiB ± 16.2 MiB -1.00 %
arco-pro_production-mode_persistent-hot + rss memory 347 MiB ± 15.2 MiB 329 MiB ± 12.1 MiB -5.17 %
arco-pro_production-mode_source-map + rss memory 727 MiB ± 9.32 MiB 728 MiB ± 13.1 MiB +0.09 %
arco-pro_production-mode_traverse-chunk-modules + rss memory 611 MiB ± 68.5 MiB 622 MiB ± 11.6 MiB +1.78 %
bundled-threejs_development-mode + rss memory 153 MiB ± 8.15 MiB 154 MiB ± 8.37 MiB +0.27 %
bundled-threejs_production-mode + rss memory 174 MiB ± 3.89 MiB 173 MiB ± 3.91 MiB -0.60 %
large-dyn-imports_development-mode + rss memory 560 MiB ± 12.5 MiB 556 MiB ± 26.3 MiB -0.83 %
large-dyn-imports_production-mode + rss memory 425 MiB ± 1.91 MiB 425 MiB ± 6.32 MiB -0.08 %
threejs_development-mode_10x + rss memory 483 MiB ± 15.5 MiB 475 MiB ± 16.8 MiB -1.51 %
threejs_development-mode_10x_hmr + rss memory 639 MiB ± 13.4 MiB 637 MiB ± 23.7 MiB -0.19 %
threejs_production-mode_10x + rss memory 652 MiB ± 10.1 MiB 647 MiB ± 10.6 MiB -0.73 %
threejs_production-mode_10x_persistent-cold + rss memory 616 MiB ± 17.6 MiB 603 MiB ± 10.7 MiB -2.08 %
threejs_production-mode_10x_persistent-hot + rss memory 406 MiB ± 19.7 MiB 400 MiB ± 11.7 MiB -1.43 %
threejs_production-mode_10x_source-map + rss memory 762 MiB ± 32.7 MiB 752 MiB ± 14.4 MiB -1.29 %

Base persistent cache hit rate: 👍

Current persistent cache hit rate: 👍

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4aea304969

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/rspack_plugin_esm_library/src/render.rs
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

📝 Rspack Ecosystem CI: Open

suite result
rspress ✅ success
rslib ❌ failure
modernjs ✅ success
rstest ❌ failure
devserver ✅ success
rsbuild-rsc-plugin ✅ success
examples ✅ success
plugin ❌ failure
rsdoctor ✅ success
lynx-stack ✅ success
rsbuild ✅ success

@LingyuCoder

Copy link
Copy Markdown
Contributor Author

📝 Rspack Ecosystem CI: Open

suite result
rspress ✅ success
rslib ❌ failure
modernjs ✅ success
rstest ❌ failure
devserver ✅ success
rsbuild-rsc-plugin ✅ success
examples ✅ success
plugin ❌ failure
rsdoctor ✅ success
lynx-stack ✅ success
rsbuild ✅ success

same with the latest main commit and just some new lines in snapshot

@hardfist

Copy link
Copy Markdown
Contributor

@codspeed explain the regression

@codspeed-hq

codspeed-hq Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

@codspeed explain the regression

Regression analysis

I re-checked the latest head run (14c80a9) against main, and the regression no longer reproduces.

Base Comparison Regressions Net impact
9fd8eb6 (latest main) head 14c80a9 0 ~+0.02%
c3c2717 (earlier main) head 14c80a9 0 ~+0.05%

✅ 52 unchanged · ⏩ 36 skipped · 0 regressed

What happened

The earlier flags — the WallTime bundle@threejs-10x-production-sourcemap (-2.07%) and the Simulation create_named_chunk_ids / mangle_exports (~2.3–2.75%) movements — were incidental, not a real hot-path regression:

  • Those benchmarks exercise compilation stages (chunk-graph root finding, export mangling, codegen/allocation) that this PR does not functionally touch. The PR only changes runtime-context rendering (__rspack_context, experiments.runtimeMode, runtime module/global handling).
  • In the flamegraphs the affected frames were overwhelmingly memory/cache-bound rather than executing more instructions — the classic fingerprint of binary-layout, inlining, and allocation-pattern shifts caused by adding the new runtimeMode code path and config field (consistent with the small +228 KB binary-size growth), not an algorithmic change.

On the current head these effects have washed out and all 52 measured benchmarks are within noise.

Recommendation

No code changes are needed — this was incidental noise, and the latest run is clean. The remaining warning on the report header is the Unknown Walltime execution environment notice: WallTime benchmarks on standard hosted runners are inherently noisier. For stable WallTime numbers, CodSpeed Macro Runners are recommended; the Simulation benchmarks are deterministic and unaffected by that warning.

If you'd like, I can re-run the comparison against any specific base commit or dig into a particular benchmark's flamegraph.

Summary
  • Warming up the performance wizard...
  • Investigating the reported regression — Latest head run shows no regressions against main; earlier flagged benchmarks were incidental layout/allocation noise in unrelated stages. No code change needed.
  • Handling comment — Posting the regression explanation
  • Handling comment — Comment handling finished successfully

Was this response helpful? React with 👍 or 👎 to help us improve CodSpeedBot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants